<%@ page import="java.net.URLEncoder" %><%--
  Created by IntelliJ IDEA.
  User: 范军建
  Date: 2022/3/28
  Time: 16:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    request.setCharacterEncoding("utf-8");
    String username=request.getParameter("username");
    String password=request.getParameter("password");
   if (username.equals("admin")&&password.equals("1234")){
       request.setAttribute("suc","成功");
       request.getRequestDispatcher("2.jsp").forward(request,response);
   }else {


       String flag =URLEncoder.encode("定向成功","utf-8");

        response.sendRedirect(request.getContextPath()+"/1.jsp?info="+flag);
    }
%>

</body>
</html>
